package my.test;

import cn.hutool.crypto.SecureUtil;

/**
 * @author yuhang
 * @desc
 * @since 2022/4/6
 */
public class SignUtilCloud {


    private static final String secret = "go2CN|20220119wearethebest";


    /**
     * 验签
     *
     * @param sign      签名
     * @param nonce     随机数
     * @param timestamp 时间戳
     * @return 是否验证成功
     */
    public static boolean verify(String sign, String nonce, String timestamp) {
        String signStr = SecureUtil.sha1(secret + nonce + timestamp);
        return sign.equals(signStr);
    }
}
